package gps.monitor.jt809server.service;


import gps.monitor.jt809server.entity.DownPlatformAccount;

import java.util.HashMap;
import java.util.List;

/**
 * 下级平台的链路
 * @author cyq
 * @date 2021/11/3
 * @desc talk is cheep,show me the code
 */
public class LinkStatusService {

    private final HashMap<Integer, DownPlatformAccount> accountHashMap = new HashMap<>();

    public void loadDownPlatformAccounts(List<DownPlatformAccount> accounts) {
        accounts.forEach(account -> accountHashMap.put(account.getCenterId(),account));
    }

    public DownPlatformAccount getDownPlatformInfo(int centerId) {
        return accountHashMap.get(centerId);
    }

}
